package com.gorkr.bio.thread_pool;

import java.io.*;
import java.net.Socket;

/**
 * @author gorkr
 * @date 2022/05/31 00:28
 **/
public class ServerRunnableTarget implements Runnable{

    private Socket socket;

    ServerRunnableTarget(Socket socket){
        this.socket = socket;
    }

    @Override
    public void run() {
        try {
            InputStream is = socket.getInputStream();
            BufferedReader bs = new BufferedReader(new InputStreamReader(is));
            String msg;
            while ((msg = bs.readLine())!=null){
                System.out.println("服务端收到："+msg);

            }


        } catch (IOException e) {
            throw new RuntimeException(e);
        }


    }
}
    